package com.payment.validator;

import org.springframework.validation.Errors;
import org.springframework.validation.ValidationUtils;
import org.springframework.validation.Validator;

import com.eventboard.domain.EventBoardCommand;

public class PaymentValidator implements Validator{

	@Override
	public boolean supports(Class<?> clazz) {
		return EventBoardCommand.class.isAssignableFrom(clazz);
	}

	@Override
	public void validate(Object target, Errors errors) {
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "name", "required");
		ValidationUtils.rejectIfEmptyOrWhitespace(errors, "amount", "required");
	}

}
